package org.jks.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.jks.response.model.ActionResult;

public class ResponseUtil {
	public static void returnJson(HttpServletResponse response, ActionResult ar){
		response.setContentType("text/html;charset=gb2312");
		PrintWriter out;
		try {
			out = response.getWriter();
			String json = JsonUtil.Object2Json(ar);
			out.write(json);
			out.flush();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
